package main

// 三角形面积用向量差积算
func largestTriangleArea(points [][]int) float64 {
	n := len(points)
	ans := 0
	for i := range n - 2 {
		for j := i + 1; j < n-1; j++ {
			for k := j + 1; k < n; k++ {
				p1, p2, p3 := points[i], points[j], points[k]
				x1, y1 := p2[0]-p1[0], p2[1]-p1[1]
				x2, y2 := p3[0]-p1[0], p3[1]-p1[1]
				ans = max(ans, abs(x1*y2-y1*x2))
			}
		}
	}
	return float64(ans) / 2
}

//func abs(x int) int {
//	if x < 0 {
//		return -x
//	}
//	return x
//}
